﻿using System;
using System.Threading;
using System.Threading.Tasks;

namespace SellAvi.Classes
{
    public static class WebService
    {
        public static async Task<string> GetPageAsync(WebClientEx client, Uri link)
        {
            // TODO: прошвырнуть токен наверх
            var token = new CancellationToken();
            await Task.Delay(TimeSpan.FromMilliseconds(new Random().Next(1000, 5000)), token).ConfigureAwait(false);
            // Download the actual data and count it.
            
            client.DownloadStringAsync(link);

            return client.ResponseHtml;

        }
    }
}
